---------------------------------------- @@ Command Post Language Summary @@ ........................................ Copyright 1988-1990, Morrie Wilson All rights reserved. This cardfile contains a quick summary of all the Command Post Menu Language functions. Wilson WindowWare 2701 California Ave SW #212 Seattle Wa, 98116 (206) 937-9335 FAX (206) 935-7129 ---------------------------------------- ---------------------------------------- @@ New Functions -- Info retrival ........................................ The following functions are not in the 7.0 manual: IsLicensed ...Tells if CP licensed IsKeyDown ...Tells about keys/mouse DOSVersion ...Returns DOS/OS2 version WinConfig ...Returns WIN3 mode flags WinPosition ...Returns Window position WinExist ...Tells is Window exists ---------------------------------------- ---------------------------------------- @@ New Functions -- Filename Parsing ........................................ The following functions are not in the 7.0 manual: FileRoot ...returns root of file FileExtension ...returns ext of file FilePath ...returns path of file ---------------------------------------- ---------------------------------------- @@ New Functions -- Network Support ........................................ The following functions are not in the 7.0 manual: DiskReset ...re-examines available disks DiskHide ...Hides disks from display ---------------------------------------- ---------------------------------------- @@ New Functions -- String Handling ........................................ The following functions are not in the 7.0 manual: StrReplace ...Replaces all occurances of a substring with another ---------------------------------------- ---------------------------------------- Menu Structure ........................................ Main Menu Name A DropDown Menu Name A-1 DropDown menu Name A-2 Main Menu Name B DropDown menu name B-1 ; Comment. ; Next line declares a 2nd .cpm file: #NextFile SECOND.CPM ---------------------------------------- ---------------------------------------- Variables ........................................ Variable names start with a letter. The rest of the name consists of letters and numbers, up to 30 characters total. Variable names are NOT case sensitive, i.e. "Cat" and "cAT" are the same variable. ---------------------------------------- ---------------------------------------- ! ........................................ The logical NOT operator. Produces @TRUE if the operand = zero, @FALSE if it's nonzero. ---------------------------------------- ---------------------------------------- & | ^ ........................................ The bitwise AND, OR, and XOR operators. The operator will arithmetically AND, OR, or exclusive-OR two integers together. a=5; = 101 b=4 = 100 c=a & b ; c=4 = 100 d=a | b ; d=5 = 101 e=a ^ b ; e=1 = 001 ---------------------------------------- ---------------------------------------- && || ........................................ The logical AND and OR operators. These operators will logically AND or OR two numbers together. a=0 ;0 means FALSE b=4 ;nonzero means TRUE c=a && b ; c is @FALSE ( 0 ) d=a || b ; d is @TRUE ( 1 ) See also & | and ^ ---------------------------------------- ---------------------------------------- ( ) ........................................ Parentheses. Parentheses are used to control the order an expression is evaluated. a = (4+5) * 2 ; a is 18 a = 4 + (5 * 2) ; a is 14 ---------------------------------------- ---------------------------------------- * / + - mod (binary) ........................................ Simple arithmetic operators. * Multiplication / Division + Addition - Subtraction mod Modulo (divide, return remainder) See also abs, min, max ---------------------------------------- ---------------------------------------- ~ ........................................ Bitwise NOT operator. Sets all 0 bits of the integer operand to 1, and vice-versa. a=26 ;=00110100 b=~a ;=11001011, or -27 ---------------------------------------- ---------------------------------------- + - (unary) ........................................ Unary arithmetic operators. + Identity - Negation ---------------------------------------- ---------------------------------------- << >> ........................................ Bitwise shift operators. << Left Shift >> Right Shift c= 16 >> 2 ; c is 4 d= 16 << 2 ; c is 64 ---------------------------------------- ---------------------------------------- = ........................................ The assigment operator. Assigns the value or string evaluated on the right side of the = sign to the variable on the left side. ---------------------------------------- ---------------------------------------- == != <> <= >= > < ........................................ Relational operators. == Equality != <> Inequality <= Less than or equal to >= Greater than or equal to < Less than > Greater than These produce 0 (@FALSE) or 1 (@TRUE). See also StrCmp, StrICmp ---------------------------------------- ---------------------------------------- Abs (number) ........................................ Returns the absolute (positive) value of an integer number. Fred=Abs(-4) ;Fred becomes 4 ---------------------------------------- ---------------------------------------- AskLine (title, prompt, default) ........................................ Gets a line of info from the user. title = title of the dialog box. prompt = question shown above edit box. default= default entry in edit box. Returns string the user enters into the edit box. ---------------------------------------- ---------------------------------------- AskYesNo (title, prompt) ........................................ Asks the user a yes or no question. title = title of the dialog box. prompt = string shown above edit box. Returns @YES or @NO depending on which button they press. ---------------------------------------- ---------------------------------------- Average (num [,num]...) ........................................ Finds the average of a list of integers. Returns average of the numbers, to the closest integer. ---------------------------------------- ---------------------------------------- Beep ........................................ Sounds a short beep at the user. Beep Message("Be Alert","We need more lerts") ---------------------------------------- ---------------------------------------- Char2Num (string) ........................................ Converts the first character of a string to its ANSI code. a=Char2Num("Z") Message("Z's ANSI Code is",a) ---------------------------------------- ---------------------------------------- ClipAppend (string) ........................................ Appends a string to the clipboard. Clipboard must contain text, or be empty. a="First" b="Second" ClipPut(a) ;clipboard = "First" ClipAppend(b) ;clipboard = "FirstSecond" ---------------------------------------- ---------------------------------------- ClipGet () ........................................ Retrieves the contents of the Clipboard into a string variable. Clipboard must contain only text. a=ClipGet() Message("Clipboard",a) ---------------------------------------- ---------------------------------------- ClipPut (string) ........................................ Clears the clipboard and inserts a "string" into it. Clipboard will be marked as containing text. a="First" b="Second" ClipPut(a) ;clipboard = "First" ClipAppend(b) ;clipboard = "FirstSecond" ---------------------------------------- ---------------------------------------- CurrentFile() ........................................ Returns the currently selected filename. The currently selected file name is the one with the dashed box around it. If could be a directory if that is what the dashed box is around. ---------------------------------------- ---------------------------------------- DateTime () ........................................ Returns the current system date and time using the format declared in the International section of the WIN.INI file. Message("Date and Time is",DateTime()) ---------------------------------------- ---------------------------------------- Debug (@ON | @OFF) ........................................ Turns the statement debugging dialog box on or off. ---------------------------------------- ---------------------------------------- Delay (seconds) ........................................ Delays "seconds" seconds. While the delay is in progress other windows will receive processing time. message("TEST","See you later") delay(10) message("TEST","I'm BAAAAAACK!") ---------------------------------------- ---------------------------------------- DirChange ([d:] path) ........................................ Changes the current directory. If the pathname includes a different drive than the current one, it will log onto the new drive. DirChange ("d:\winword") DirChange ("mysubdir") ---------------------------------------- ---------------------------------------- DirGet () ........................................ Returns the current directory. ---------------------------------------- ---------------------------------------- DirHome () ........................................ Returns the path to the Command Post executable files. ---------------------------------------- ---------------------------------------- DirItemize (dir-spec) ........................................ Returns either all the highlighted directories (if dir-spec = "") or the list of directories matching a set of wildcards. Usually "*.*" is used. The directory names are separated by spaces. DirItemize("") ;returns hilited dirs DirItemize("*.*") ;returns all dirs ---------------------------------------- ---------------------------------------- DirMake ([d:] path) ........................................ Creates a new directory. DirMake ("Child") DirMake ("..\..\Uncle") DirMake ("..\..\Uncle\Cousin") ---------------------------------------- ---------------------------------------- DirRemove ([d:] path) ........................................ Deletes a directory. DirRemove ("..\..\Uncle\Cousin") ---------------------------------------- ---------------------------------------- DiskFree (drive-list) ........................................ Returns the total available free space of all drives in the list. a=DiskFree("C D") ;get free space a=a/1024 ;convert to "K" Message ("Free space on C&D","%a%K") ---------------------------------------- ---------------------------------------- DiskHide (Drive-Letter-List) ........................................ Instructs Command Post to suppress the disk drive icon display for all drives in the Drive-Letter-List. E.G. If you are on a network, and NEVER care what drives S,T,U,V and W have on them, you may issue the command: DiskHide("STUVW") ---------------------------------------- ---------------------------------------- DiskReset () ........................................ DiskReset causes Command Post to re-examine all attached drives. This command is used after attaching or detaching network drives to re-sync the display to the state of the network. ---------------------------------------- ---------------------------------------- Display (seconds, title, text) ........................................ Displays a message for the indicated number of seconds. You can stop the display by clicking on the message box with the mouse or pressing a key. Display(5,"!!!","Bye bye in 5 seconds") ---------------------------------------- ---------------------------------------- DOSVersion (@MAJOR | @MINOR) ........................................ Returns the version numbers of the current version of DOS. "level" = @MAJOR returns the integer part and @MINOR returns the decimal part (to the right of the decimal). r=DOSVersion(@MAJOR) v=DOSVersion(@MINOR) Message("DOS Version","%r%.%v%") ---------------------------------------- ---------------------------------------- Drop (var [,var]...) ........................................ Deletes variables from the varaible list, thus conserving memory. This is a recommended practice for local variables. ---------------------------------------- ---------------------------------------- EndSession () ........................................ Ends the current Windows session. Has the same effect as choosing File/Exit in Win 2.x, or closing the Program Manager in Win 3.0 ---------------------------------------- ---------------------------------------- Environment (env-variable) ........................................ Returns the contents of a DOS environ- ment variable. a=Environment("PATH") Message("Your PATH is",a) ---------------------------------------- ---------------------------------------- ErrorMode(@OFF | @NOTIFY | @CANCEL) ........................................ Controls the error handling mode. @CANCEL (the default): Cancels the menu item at any error. @NOTIFY: Informs the user and allows her to continue if the error is recoverable. @OFF: Same as @NOTIFY, but suppresses any recoverable errors. ERRORMODE(@OFF) ---------------------------------------- ---------------------------------------- Execute statement ........................................ Executes a statement in an "error protected" environment. Any error will be recoverable. Often used to interactively execute user-typed statements. A=AskLine("DO","Enter Stmt","") Execute %A% ---------------------------------------- ---------------------------------------- Exit ........................................ Used to end processing a menu item. Exit is assumed at the end of all menu items. b=0 Exit ---------------------------------------- ---------------------------------------- FileCopy (from-list, to-name, warn) ........................................ Copies one or more filenames to the destination "to-name". Wildcards may be used. If more than one file is copied, to-name should be a wildcard. If "warn" is @TRUE, the user will get a warning before overwriting a file. FileCopy("C:\win\*.*", "A:", @TRUE) ---------------------------------------- ---------------------------------------- FileDelete (file-list) ........................................ Deletes one or more files. More than one filename may be specified. Wildcards may be used. FileDelete("*.BAK *.OLD") ---------------------------------------- ---------------------------------------- FileExist (filename) ........................................ Determines whether or not a file exists. Returns @TRUE or @FALSE. Unless it is a full pathname, The current directory will be checked, and then all directories on the DOS PATH will be checked. a=FileExist ("WIN.INI") a=FileExist ("c:\windows\win.ini") ---------------------------------------- ---------------------------------------- FileExtension (filename) ........................................ FileExtension parses the passed filename and returns the extension part of the filename. ---------------------------------------- ---------------------------------------- FileItemize (file-list) ........................................ Returns either a list of highlighted files (if file-list = "") or the list of files matching the set of wildcards specified. The filenames are separated by spaces. FileItemize("") ;returns hilited files FileItemize("*.BAK") ;returns all BAK's FileItemize("*.ARC *.ZIP *.LZH") ;returns list of compressed files ---------------------------------------- ---------------------------------------- FileLocate (filename) ........................................ Attempts to find "filename" in the current directory, and along the DOS PATH. If found, the function will return the complete pathname to the file. a=FileLocate("WIN.INI") Message("WIN.INI is located in",a) ---------------------------------------- ---------------------------------------- FileMove (from-list, to-name, warn) ........................................ Moves one or more filenames to the destination "to-name". Wildcards may be used. If more than one file is moved, "to-name" should be a wildcard. If the destination is on the same drive, a rename will occur instead of a move. If "warn" = @TRUE the user gets a warning before overwriting a file. FileMove("C:\win\*.*","A:",@TRUE) ---------------------------------------- ---------------------------------------- FilePath (filename) ........................................ FilePath parses the passed filename and returns the drive and path of the file specification, if any. ---------------------------------------- ---------------------------------------- FileRename (file-list, to-name) ........................................ Renames one or more filenames to the destination "to-name". Wildcards may be used. If more than one file is renamed, "to-name" should be a wildcard. The destination MUST be on the same drive as the source. You may wish to use FileMove instead of FileRename. FileMove("C:\win\*.*","A:") ---------------------------------------- ---------------------------------------- FileRoot (filename) ........................................ FileRoot parses the passed filename and returns the root part of the filename. ---------------------------------------- ---------------------------------------- FileSize (file-list) ........................................ Adds the sizes of all the files in the list and returns the total. a=FileSize(FileItemize("*.*")) Message("Size of all files in dir",a) ---------------------------------------- ---------------------------------------- IniRead (section, keyword, default) ........................................ Looks up a value in the WIN.INI file. If the value is not found, the "default" will be returned. IniRead ("windows","device","none") will look in [windows] device=... and return the default ptr or "none". ---------------------------------------- ---------------------------------------- IniWrite (section, keyword, data) ........................................ Modifies the WIN.INI file with the desired data. IniWrite("CmdPost","MyVar",5) will create a new keyword entry in the CmdPost section: [CmdPost] MyVar=5 ---------------------------------------- ---------------------------------------- IsDefined (variable) ........................................ Determines whether or not a variable has been defined. Returns @YES or @NO. ---------------------------------------- ---------------------------------------- IsKeyDown(key-codes) ........................................ Determines if the SHIFT key or the CTRL key is currently down. IsKeyDown(@SHIFT) IsKeyDown(@CTRL) IsKeyDown(@CTRL|@SHIFT) IsKeyDown(@CTRL&@SHIFT) Returns TRUE or FALSE. Note: Right Mouse button same as SHIFT Middle button same as CTRL ---------------------------------------- ---------------------------------------- IsLicensed() ........................................ Returns whether or not the current version of Command Post is a licensed copy or not. Mainly used to predict what CP's window titles are going to be. In the unlicensed versions, the titles are fixed. In licensed versions, they are programmable. ---------------------------------------- ---------------------------------------- IsMenuChecked (menuname) ........................................ Determines whether or not a menu item is currently checked. Returns @YES or @NO. ---------------------------------------- ---------------------------------------- IsMenuEnabled (menuname) ........................................ Determines whether or not a menu item is currently enabled (i.e. not grayed). Returns @YES or @NO. Terminate(!IsMenuEnabled,"ViewName","") ---------------------------------------- ---------------------------------------- IsNumber (string) ........................................ Determines if a string can be converted into a number. Returns @YES or @NO. n=AskLine("TEST","Enter a number",entry) Terminate(!IsNumber(entry),"Must Enter a Number") ---------------------------------------- ---------------------------------------- IsRunning () ........................................ Returns @TRUE if another copy of Command Post is already running. Returns @FALSE if this is the first instance of Command Post. ---------------------------------------- ---------------------------------------- Itemselect (title, list, delimiter) ........................................ Returns a single item chosen from a list box presented to the user. The items in the list must be separated by the "delimiter" character - usually " " for dirs and files, and a tab for window titles. a=FileItemize("*.DOC") a=ItemSelect("Files",a," ") b=WinItemize() b=ItemSelect("Windows",b,char2num(9)) ---------------------------------------- ---------------------------------------- LastError () ........................................ Returns a numeric value representing the last error that occurred. Each error has a different value. 0 means no error occurred. To use use LastError, ErrorMode() must be set to @NOTIFY or @OFF to avoid the default @CANCEL on error recovery. ---------------------------------------- ---------------------------------------- LogDisk (diskdrive) ........................................ Selects the first character of the "diskdrive" string and logs that disk as the current disk. DirChange will log a new drive if the pathname you want to change to is on a different one than the current one. LogDisk("D") ---------------------------------------- ---------------------------------------- Max (num [,num]...) ........................................ Examines a series of integers and returns the largest number in the list. a=max(100, -50, 30, 200, 10) message("answer will be 200",a) ---------------------------------------- ---------------------------------------- MenuChange (menuname, flags) ........................................ Changes a menu item to be checked or unchecked, enabled or disabled(grayed). The permissable flags are @CHECK or @UNCHECK @ENABLE or @DISABLE @CHECK or @UNCHECK may be or'ed with @ENABLE or @DISABLE using the | operator. ---------------------------------------- ---------------------------------------- Message (title, text) ........................................ Displays a message box to the user, with a specified "title" and "text". There will be an OK button for the user to press. Message("Hello","This is an example.") ---------------------------------------- ---------------------------------------- Min (num [,num]...) ........................................ Examines a series of integers and returns the smallest number in the list. a=min(100, -50, 30, 200, 10) message("answer will be -50", a) ---------------------------------------- ---------------------------------------- Num2Char (number) ........................................ Converts a number to a one-character string. Use this to display special ANSI characters. tab=num2char(9) c=num2char(169) ;(c) symbol Message("Command Post", "%c%1990") ---------------------------------------- ---------------------------------------- OtherDir () ........................................ Returns the drive and directory that the "other" (second-most recently used) Command Post window is set to. If there is no other Command Post window (or if this one was the first), then the disk and directory of the current window will be used. a=OtherDir() Message("The Other Directory is",a) ---------------------------------------- ---------------------------------------- OtherUpdate () ........................................ Causes the "other" (second-most recently used) Command Post window to update its display. This command is useful when the current Command Post window may have altered the directory or file structure so that an update is desirable. ---------------------------------------- ---------------------------------------- Pause (title, text) ........................................ Presents the user with a message box, using the "title" and "text" supplied. The box has two buttons - OK and CANCEL. If OK is selected, processing continues. If CANCEL is selected, processing terminates. Pause("Hey You","Insert Floppy in A:") FileCopy("C:\DOC\*.DOC","A:") ---------------------------------------- ---------------------------------------- Random (max) ........................................ Returns a psuedo-random integer between 0 and "max". A=Random(10) ; between 0 and 10 B=Random(20) ; between 0 and 20 c=Random(10)+10 ; between 10 and 20 ---------------------------------------- ---------------------------------------- Run (program, parameters) ........................................ Runs a "program" with the specified "parameters". The program's window is passed a request to show itself as a default window size & position. Run("notepad.exe","win.ini") run("Clock.exe","") ; note empty parms ---------------------------------------- ---------------------------------------- RunHide (program, parameters) ........................................ Runs a "program" with the specified "parameters". The program's window is passed a request to hide itself. RunHide("notepad.exe","win.ini") runHide("Clock.exe","") ; no parms ---------------------------------------- ---------------------------------------- RunIcon (program, parameters) ........................................ Runs a "program" with the specified "parameters". The program's window is passed a request to show itself as an icon ('minimized' window). RunIcon("notepad.exe","win.ini") runIcon("Clock.exe","") ; no parms ---------------------------------------- ---------------------------------------- RunZoom (program, parameters) ........................................ Runs a "program" with the specified "parameters". The program's window is passed a request to show itself as a full-screen ('maximized') window. RunZoom("notepad.exe","win.ini") runZoom("sol.exe","") ; no parms ---------------------------------------- ---------------------------------------- SetDisplay (detail, sort, masks) ........................................ Configures the Command Post window. detail - "SHORT" or "LONG" sort- "NAME",KIND","DATE","SIZE", or "UNSORTED" masks- which files to show If all parms = "", the current Command Post directory will be refreshed and displayed. SetDisplay("SHORT","NAME","*.*"); defalt SetDisplay("","","") ; update currdir SetDisplay("","","*.EXE *.COM *.BAT") ---------------------------------------- ---------------------------------------- StrCat (string [,string]...) ........................................ Concatenates any number of strings together and returns the concatenated string. crlf=strcat(num2char(13),num2char(10)) a=strcat("line1",crlf,"line2") ;a="line1 line2" ---------------------------------------- ---------------------------------------- StrCmp (string1, string2) ........................................ Compares two strings and return one of three possible values: if "string1" is before "string2" -1 if "string1" equals "string2" 0 if "string1" is after "string2" 1 ---------------------------------------- ---------------------------------------- StrFill (source, length) ........................................ Creates a string by concatenating multiple copies of the "source" string to itself until the string length equals "length". aa=Strfill("*",20) message("20 Stars",aa) ---------------------------------------- ---------------------------------------- StrFix (base, pad, length) ........................................ If the "base" string is longer than "length" it will be truncated, else if it's shorter than "length" it will be padded with the "pad" string until it is "length" in size. ---------------------------------------- ---------------------------------------- StrICmp (string1, string2) ........................................ Compares two strings and returns one of three possible values, IGNORING CASE: if "string1" is before "string2" -1 if "string1" equals "string2" 0 if "string1" is after "string2" 1 ---------------------------------------- ---------------------------------------- StrIndex (string, substring, start, dir) ........................................ Searches the "string", looking for the first occurrance of the "substring" after the "start" position. "dir" may be either @FWDSCAN or @BACKSCAN to control the direction of the search. example: to parse filename: a=CurrentFile() i=strindex(a,".",1,@FWDSCAN) root=strsub(a,1,i-1) ext =strsub(a,i+1,strlen(a)-i) ---------------------------------------- ---------------------------------------- StrLen (string) ........................................ Returns the length of a "string". a="ABCDE" Message("Length of ABCDE is",strlen(a)) ---------------------------------------- ---------------------------------------- StrLower (string) ........................................ Returns the lowercase version of a "string". a=AskLine("Please","Enter Name","") a=strlower(a) b=strsub(a,1,1) b=strupper(b) c=strsub(a,2,strlen(a)-1) a=strcat(b,c) Message("Thanx",a) ---------------------------------------- ---------------------------------------- StrReplace(string,old,new) ........................................ StrReplace scans the 'string', searching for occurrances of 'old' and replacing each occurrance with 'new'. e.g. Copy highlited files to clipboard: a=FileItemize("") crlf=StrCat(Num2Char(13),Num2Char(10)) StrReplace(a," ",crlf) ClipPut(a) ---------------------------------------- ---------------------------------------- StrScan (main, delims, start, dir) ........................................ Scans a "string" for the first occurrance of ANY character in the "delims" string. The scanning starts at "start" position and goes in the "dir" direction, which may be either @FWDSCAN or @BACKSCAN. ---------------------------------------- ---------------------------------------- StrSub (string, start, length) ........................................ Returns the substring of "string" which starts in position "start" and goes for "length" characters. ---------------------------------------- ---------------------------------------- StrTrim (string) ........................................ Removes all leading and training spaces, if any, from "string" and returns the trimmed string. ---------------------------------------- ---------------------------------------- StrUpper (string) ........................................ Returns the uppercase version of a "string". a=AskLine("Please","Enter Name","") a=strlower(a) b=strsub(a,1,1) b=strupper(b) c=strsub(a,2,strlen(a)-1) a=strcat(b,c) Message("Thanx",a) ---------------------------------------- ---------------------------------------- Terminate (condition, title, msg) ........................................ Tests a "condition", and cancels the menu item if it = @TRUE. If "title" or "msg" are not null strings, displays a message box before terminating. a=AskLine("Hi","Enter your age","") terminate(!IsNumber(a),"","Use numbers") terminate(a<1 || a>100),"ERR","Ha Ha") message("Hi","Your age is %a%") ---------------------------------------- ---------------------------------------- TextBox (title, filename) ........................................ Displays a file in a listbox with a "title". It may be used for multiline messages or instructions. If the user highlights a line, it will be returned as a text string, thus TextBox can also be used as a selection box. TextBox("CONFIG.SYS","C:\CONFIG.SYS") ---------------------------------------- ---------------------------------------- Version () ........................................ Returns the version of the current Command Post program. a=Version() Message("Command Post","Version %a%") ---------------------------------------- ---------------------------------------- WinActivate (partialwindowname) ........................................ Activates the named window. Only the first part of the "partialwindowname" is required. a=WinItemize() a=ItemSelect("Choose a Window",a) WinActivate(a) ---------------------------------------- ---------------------------------------- WinArrange (style) ........................................ Tiles, stacks, arranges in rows or arranges in columns the various open windows on the screen. "style" may be @ROWS or @COLUMNS or @STACK or @ARRANGE WinArrange("Stack") ---------------------------------------- ---------------------------------------- WinClose (partialwindowname) ........................................ Closes the first window found in which the first part of the windows name matches "partialwindowname". WinClose("Clock") WinClose("Clo") ---------------------------------------- ---------------------------------------- WinCloseNot (pwn [,pwn]...) ........................................ Closes all the windows EXCEPT the ones that match the "partialwindowname"s in the parameter list. WinCloseNot("MS-DOS","Clock","PageMa") ---------------------------------------- ---------------------------------------- WinConfig () ........................................ Returns the Windows configuration information as a number. Bits are defined as follows: 1 Protect Mode | 64 8086 CPU 2 80286 CPU | 128 80186 CPU 4 80386 CPU | 256 Large PageFrame 8 80486 CPU | 512 Small PageFrame 16 Standard Mode |1024 80x87 Installed 32 Enhanced Mode | ---------------------------------------- ---------------------------------------- WinExist (partialwindowname) ........................................ Returns @TRUE or @FALSE, depending on whether a matching window can be found. a=WinExist("Clock") ---------------------------------------- ---------------------------------------- WinGetActive () ........................................ Returns the complete title of the currently active window. Unless a WinActivate or other command was used, WinGetActive will generally return the current Command Post's window title. a=WinGetActive() Message("Active window was",a) ---------------------------------------- ---------------------------------------- WinHide (partialwindowname) ........................................ Hides the first window in which the first part of the window name matches "partialwindowname". The window still exists, but is not available to the user until a WinShow command is executed. run("clock.exe","") WinHide("Clock") ---------------------------------------- ---------------------------------------- WinIconize (partialwindowname) ........................................ Iconizes ('minimizes') the first window in which the first part of the window name matches "partialwindowname". Run("Clock.exe","") WinIconize("Clock") ;equivalent to RunIcon("Clock.exe","") ---------------------------------------- ---------------------------------------- WinItemize () ........................................ Returns a list of all the currently- running windows, by window title, separated by tabs within the string. ;Closes selected window a=WinItemize() a=ItemSelect("CLOSE",a) WinCLose(a) ---------------------------------------- ---------------------------------------- WinPlace (x-ul, y-ul, x-br, y-br, pwn) ........................................ Places and sizes a window anywhere on the screen. Use the WININFO.EXE utility to help write the WinPlace statements. x-ul x co-ordinate upper left y-ul y co-ordinate upper left x-br x co-ordinate bottom right y-br y co-ordinate bottom right pwn partial window name WinPlace(10,10,300,300,"Clock") ---------------------------------------- ---------------------------------------- WinPosition (partialwindowname) ........................................ Returns the current Window position information for the selected Window. It returns 4 comma separated numbers. a=WinPosition("Clock") A return value for the above function might be "0,0,100,100". ---------------------------------------- ---------------------------------------- WinShow (partialwindowname) ........................................ Shows the first window in which the first part of the window name matches "partialwindowname". runhide("clock.exe","") WinShow("Clock") ---------------------------------------- ---------------------------------------- WinTitle (pwn, new-name) ........................................ Changes the title of the first window in which the first part of the window name matches "pwn". That window will be named "new-name". A pwn of "" is the current Command Post Window. Note: Some applications do not take kindly to having their window's title changed. WinTitle( "", "My Menu") ---------------------------------------- ---------------------------------------- WinVersion (@MAJOR | @MINOR) ........................................ Returns the version numbers of the current version of Windows. "level" = @MAJOR returns the integer part and @MINOR returns the decimal part (to the right of the decimal). r=WinVersion(@MAJOR) v=WinVersion(@MINOR) Message("Windows Version","%r%.%v%") ---------------------------------------- ---------------------------------------- WinWaitClose (partialwindowname) ........................................ Suspends menu execution until there are no windows in which the first part of the window title matches "partialwindowname". run("notepad.exe","special.txt") Message("Edit file","Close when done") WinWaitClose("Notepad") Message("Edit file","You may continue") ---------------------------------------- ---------------------------------------- WinZoom (partialwindowname) ........................................ Zooms ('maximizes') the first window in which the first part of the window name matches "partialwindowname". Run("clock.exe","") WinZoom("Clock") ;equivalent to RunZoom("clock.exe","") ---------------------------------------- ---------------------------------------- Yield ........................................ Suspends menu execution for enough time for other windows to process a few messages. run("this.exe","") run("that.exe","") run("andthe.exe","") run("other.exe","") Yield Message("All Done","Now what?") ----------------------------------------